﻿using Quartz;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using WeChartWorkRobot.Model;
using WeChartWorkRobot.Model.DTO;
using WeChartWorkRobot.Service;
using WeChartWorkRobot.Service.Jobs;

namespace WeChartWorkRobot.Service
{
    public class SendMsgJob : Jobs.IJob
    {
        public void Execute(ExecuteContext context)
        {
            Console.WriteLine("CommonTexgMsg任务执行");
            LogHelper.Debug("CommonTexgMsg任务执行");

            WxMsg wxMsg = (WxMsg)context.GetData("wxMsg");

            if (string.IsNullOrEmpty(wxMsg.content))
            {
                LogHelper.Error("content不能为空");
                return;
            }
            if (wxMsg.msg_type == 1)
            {
                SendMsg.SendMarkDownMsg(wxMsg);
            }
            else
            {
                SendMsg.SendTextMsg(wxMsg);
            }
        }
    }
}
